<template>
  <div class="operatetab-container">
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="操作日志" name="first">
        <table-index :tab="tab" v-if="tab === '0'"></table-index>
      </el-tab-pane>
      <el-tab-pane label="查询日志" name="second">
        <table-index :tab="tab" v-if="tab === '1'"></table-index>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import tableIndex from "./table.vue";
export default {
  components: { tableIndex },
  data() {
    return {
      activeName: "first",
      tab: "0"
    };
  },
  methods: {
    handleClick(tab) {
      console.log(tab);
      this.activeName = tab.name;
      this.tab = tab.index;
    }
  }
};
</script>

<style lang="scss" scoped>
.operatetab {
  &-container {
    margin: 10px 20px;
  }
}
</style>